FROM centos:7.6.1810

COPY ./ /home/soft
COPY ./flink-start.sh /home

RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo 'Asia/Shanghai' >/etc/timezone && \
mkdir /home/flink && chmod +x /home/flink-start.sh && \
tar xzf /home/soft/jdk-8u271-linux-x64.tar.gz -C /usr/local && \
tar xzf /home/soft/flink-1.11.2-bin-scala_2.11.tgz -C /home/flink --strip-components 1 && \
mv /home/soft/jar/*.jar /home/flink/lib/ && \
rm -rf /home/soft && \
sed -i '60c taskmanager.numberOfTaskSlots: 8' /home/flink/conf/flink-conf.yaml

ENV JAVA_HOME=/usr/local/jdk1.8.0_271
ENV JRE_HOME=/usr/local/jdk1.8.0_271/jre
ENV CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
ENV PATH=$PATH:${JAVA_HOME}/bin


EXPOSE 8081
CMD ["/home/flink-start.sh"]

# docker build -t adflink:1.0 ./
# docker run -it --name adflink  --link adkafka:adkafka.com -p 8081:8081 -v /Users/adong/code/docker/flink:/home/dev:rw adflink:1.0